alter table jms_dm.dm_shipment_stop_billcode_detail_dt set tblproperties ('external.table.purge'='true');
drop table jms_dm.dm_shipment_stop_billcode_detail_dt;
CREATE EXTERNAL TABLE jms_dm.dm_shipment_stop_billcode_detail_dt(
  shipment_no string COMMENT '任务编号',
  shipment_name string COMMENT '任务名称',
  shipment_start_code string COMMENT '始发中心编号',
  shipment_start_name string COMMENT '始发中心名称',
  shipment_end_code string COMMENT '目的中心编号',
  shipment_end_name string COMMENT '目的中心名称',
  business_attribute string COMMENT '业务属性 1:正班 2:加班',
  ship_plan_dep_time timestamp COMMENT '规划发车时间',
  ship_plan_arr_time timestamp COMMENT '规划到车时间',
  ship_act_plan_time timestamp COMMENT '实际发车时间',
  ship_act_arr_time timestamp COMMENT '实际到车时间',
  vehicletype_name string COMMENT '车型',
  shipment_state int COMMENT '任务状态,待调度0 已调度1 待执行2 在途3 已完成4 已作废5',
  send_sort int COMMENT '发车站点排序',
  arr_sort int COMMENT '到车站点排序',
  start_site_code string COMMENT '发车站点code',
  start_site_name string COMMENT '发车站点name',
  load_next_site_code string COMMENT '到车站点code',
  load_next_site_name string COMMENT '到车站点name',
  planned_departure_time timestamp COMMENT '发车站点的计划发车时间',
  actual_departure_time timestamp COMMENT '发车站点的实际发车时间',
  planned_arrival_time timestamp COMMENT '到车站点的计划到车时间',
  actual_arrival_time timestamp COMMENT '到车站点实际到车时间',
  estimate_arrival_time timestamp COMMENT '计划到车时间',
  billcode string COMMENT '单号',
  load_scan_time timestamp COMMENT '发车站点装车发件时间',
  unload_scan_time timestamp COMMENT '到车站点卸车到站时间',
  is_trunk_branch int COMMENT '支干线类型1干线2支线')
COMMENT '任务号经停点装卸车单号明细'
PARTITIONED BY (
  dt string COMMENT '时间分区 规划发车日期')
STORED AS PARQUET
LOCATION '/dw/hive/jms_dm.db/external/dm_shipment_stop_billcode_detail_dt'
TBLPROPERTIES (
    'discover.partitions' = 'false',
    'parquet.column.index.access' = 'true'
    );